From dddce819d11f8e137b51608559867f28d2b02299 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 21 Nov 2007 09:49:09 +0000 Subject: [PATCH] hvm: Do not crash guest if it does an unaligned access to an HPET register. Some CrashMe test apaprently does this and we don't want that to crash the domain it runs in. From: Dexuan Cui Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/hpet.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index 5954955809..ee7d91f652 100644 --- a/xen/arch/x86/hvm/hpet.c +++ b/xen/arch/x86/hvm/hpet.c @@ -127,9 +127,13 @@ static inline int hpet_check_access_length( { if ( (addr & (len - 1)) || (len > 8) ) { - gdprintk(XENLOG_ERR, "HPET: access across register boundary: " + /* + * According to ICH9 specification, unaligned accesses may result + * in unexpected behaviour or master abort, but should not crash/hang. + * Hence we read all-ones, drop writes, and log a warning. + */ + gdprintk(XENLOG_WARNING, "HPET: access across register boundary: " "%lx %lx\n", addr, len); - domain_crash(current->domain); return -EINVAL; } -- 2.30.2